package com.kcral.javase.ch.properties;

/**
 * @TODO
 * @Author xu
 * 2025/3/3
 */
public class EmployeeUtil {
    public static void bonus(Employee e) {
        double currentSalary = e.getSalary();
        double newSalary;

        // 判断薪资并计算新的薪资
        if (currentSalary > 10000) {
            newSalary = currentSalary * 1.20; // 提薪20%
        } else {
            newSalary = currentSalary * 1.10; // 提薪10%
        }

        // 更新员工薪资
        e.setSalary(newSalary);
        System.out.println("员工 " + e.getName() + " 的新薪资为: " + newSalary);
    }

}
